package com.itouchtv.yang.core.redis;

import cn.hutool.db.nosql.redis.RedisDS;
import redis.clients.jedis.Jedis;

import java.util.Objects;

public class Redis {
    private static Jedis instance = null;
    private Redis(){}
    public static Jedis getInstanse(){
        if (Objects.isNull(instance)){
            return RedisDS.create().getJedis();
        }
        return instance;
    }

    public static void close(){
        if (!Objects.isNull(instance)){
            instance.close();
        }
    }
}
